home *** CD-ROM | disk | FTP | other *** search
- package javax.swing.plaf.basic;
-
- import java.awt.Rectangle;
- import javax.swing.event.TreeSelectionEvent;
- import javax.swing.event.TreeSelectionListener;
- import javax.swing.tree.TreePath;
-
- public class BasicTreeUI$TreeSelectionHandler implements TreeSelectionListener {
- // $FF: synthetic field
- private final BasicTreeUI this$0;
-
- public BasicTreeUI$TreeSelectionHandler(BasicTreeUI var1) {
- this.this$0 = var1;
- }
-
- public void valueChanged(TreeSelectionEvent var1) {
- this.this$0.completeEditing();
- if (this.this$0.treeSelectionModel != null) {
- TreePath[] var2 = this.this$0.treeSelectionModel.getSelectionPaths();
- if (var2 != null) {
- for(int var3 = var2.length - 1; var3 >= 0; --var3) {
- this.this$0.tree.makeVisible(var2[var3]);
- }
- }
- }
-
- TreePath var11 = BasicTreeUI.access$1(this.this$0);
- this.this$0.lastSelectedRow = this.this$0.tree.getMinSelectionRow();
- TreePath var12 = this.this$0.tree.getLeadSelectionPath();
- BasicTreeUI.access$2(this.this$0, var12);
- BasicTreeUI.access$3(this.this$0, var12);
- TreePath[] var4 = var1.getPaths();
- Rectangle var6 = this.this$0.tree.getVisibleRect();
- boolean var7 = true;
- int var8 = this.this$0.tree.getSize().width;
- if (var4 != null) {
- int var10 = var4.length;
- if (var10 > 4) {
- this.this$0.tree.repaint();
- var7 = false;
- } else {
- for(int var9 = 0; var9 < var10; ++var9) {
- Rectangle var5 = this.this$0.getPathBounds(this.this$0.tree, var4[var9]);
- if (var5 != null && var6.intersects(var5)) {
- this.this$0.tree.repaint(0, var5.y, var8, var5.height);
- }
- }
- }
- }
-
- if (var7) {
- Rectangle var13 = this.this$0.getPathBounds(this.this$0.tree, var1.getOldLeadSelectionPath());
- if (var13 != null && var6.intersects(var13)) {
- this.this$0.tree.repaint(0, var13.y, var8, var13.height);
- }
-
- var13 = this.this$0.getPathBounds(this.this$0.tree, var1.getNewLeadSelectionPath());
- if (var13 != null && var6.intersects(var13)) {
- this.this$0.tree.repaint(0, var13.y, var8, var13.height);
- }
-
- var13 = this.this$0.getPathBounds(this.this$0.tree, var11);
- if (var13 != null && var6.intersects(var13)) {
- this.this$0.tree.repaint(0, var13.y, var8, var13.height);
- }
- }
-
- }
- }
-